//package com.ruoyi.common.utils.excel;
//
//import com.alibaba.excel.EasyExcel;
//import com.ruanwei.commons.utils.CharMethod;
//import com.ruanwei.commons.utils.CurrencyExcelListener;
//import com.ruanwei.commons.utils.Snow;
//import com.ruanwei.dict.excel.service.ImportExcelService;
//import com.ruanwei.mapper.CatalogueOfDiseasesInTraditionalChineseMedicineMapper;
//import com.ruanwei.mapper.TcmSyndromeCatalogueMapper;
//import com.ruanwei.pojo.CatalogueOfDiseasesInTraditionalChineseMedicine;
//import com.ruanwei.pojo.TcmSyndromeCatalogue;
//import com.ruanwei.pojo.bo.ColumnBO;
//import org.springframework.stereotype.Service;
//
//import javax.annotation.Resource;
//import java.io.InputStream;
//import java.text.SimpleDateFormat;
//import java.time.LocalDate;
//import java.time.LocalDateTime;
//import java.time.ZoneId;
//import java.time.temporal.ChronoUnit;
//import java.util.Calendar;
//import java.util.Date;
//import java.util.HashMap;
//import java.util.List;
//
//@Service
//public class ImportExcelServiceImpl implements ImportExcelService {
//
//    @Resource
//    private Snow snow;
//
//    @Resource
//    private TcmSyndromeCatalogueMapper tcmSyndromeCatalogueMapper;
//
//    @Resource
//    private CatalogueOfDiseasesInTraditionalChineseMedicineMapper catalogueOfMapper;
//
//    @Override
//    public void importTCMSyndromeCatalogue(InputStream is, List<ColumnBO> columnBOS) {
//        EasyExcel.read(is, TcmSyndromeCatalogue.class, new CurrencyExcelListener(TcmSyndromeCatalogue.class,tcmSyndromeCatalogueMapper, columnBOS){
//            @Override
//            public Object convenientObject(Object object){
//                TcmSyndromeCatalogue object1 = (TcmSyndromeCatalogue) object;
//                object1.setId(snow.nextIdString());
//                object1.setDataCrteTime(LocalDateTime.now());
//                object1.setDataUpdtTime(LocalDateTime.now());
//                //证候类目名称
//                object1.setPinyinCode(CharMethod.firstPinyinToUpperCase(object1.getSyndCatyName()));
//
//                return object1;
//            }
//        }).sheet(0).doRead();
//    }
//
//    @Override
//    public void importCatalogueChineseMedicine(InputStream is, List<ColumnBO> columnBOS) {
//        EasyExcel.read(is, CatalogueOfDiseasesInTraditionalChineseMedicine.class, new CurrencyExcelListener(CatalogueOfDiseasesInTraditionalChineseMedicine.class,catalogueOfMapper, columnBOS){
//            @Override
//            public Object convenientObject(Object object){
//                CatalogueOfDiseasesInTraditionalChineseMedicine object1 = (CatalogueOfDiseasesInTraditionalChineseMedicine) object;
//                object1.setId(snow.nextIdString());
//                object1.setDataCrteTime(LocalDateTime.now());
//                object1.setDataUpdtTime(LocalDateTime.now());
//                //科别类目名称
//                object1.setPinyinCode(CharMethod.firstPinyinToUpperCase(object1.getCatyFmlyName()));
//                return object1;
//            }
//        }).sheet(0).doRead();
//    }
//
//    /**
//     * 查询全国医保中医证候目录
//     *
//     * @param keyword  关键字，可以不传
//     * @param page     页码
//     * @param pageSize 条目数
//     * @return \
//     */
//    @Override
//    public Object selectTCMSyndromeCatalogue(String keyword,Integer page,Integer pageSize) {
//        HashMap<String, Object> stringListHashMap = new HashMap<>();
//        stringListHashMap.put("total",tcmSyndromeCatalogueMapper.count());
//        stringListHashMap.put("data",tcmSyndromeCatalogueMapper.selectTcmSyndromeCatalogueListByName(keyword,page == null ? 0 :page,pageSize == null ? 10 :pageSize));
//        return stringListHashMap;
//    }
//
//    /**
//     * 查询全国医保中医疾病目录
//     *
//     * @param keyword  关键字，可以不传
//     * @param page     页码
//     * @param pageSize 条目数
//     * @return \
//     */
//    @Override
//    public Object selectCatalogueChineseMedicine(String keyword,Integer page,Integer pageSize) {
//        HashMap<String, Object> stringListHashMap = new HashMap<>();
//        stringListHashMap.put("total",catalogueOfMapper.count());
//        stringListHashMap.put("data",catalogueOfMapper.selectCatalogueListByName(keyword,page == null ? 0 :page,pageSize == null ? 10 :pageSize));
//        return stringListHashMap;
//    }
//}
